//重写控制器过滤器的设置
package com.wzy.wzyblog.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

//配置类注解
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//                                加入自定义的过滤网
        registry.addInterceptor(new LoginInterceptor())
//                 要拦截的路径          admin下的所有
                .addPathPatterns("/admin/**")
//                排除登录页面             排除提交用户信息表单
                .excludePathPatterns("/admin")
                .excludePathPatterns("/admin/login")
                .excludePathPatterns("/images/*");
    }
}
